#pragma once
#include<iostream>
#include<vector>
#include<unistd.h>
#include<sys/types.h>
using namespace std;



typedef void (*fun_t)(); //函数指针

void Print()
{
    cout<<"pid:"<<getpid()<<"打印任务正在执行---"<<endl;
}

void Insert()
{

     cout<<"pid:"<<getpid()<<"插入任务正在执行---"<<endl;

}

void POP()
{
    cout<<"pid:"<<getpid()<<"删除任务正在执行---"<<endl;
}

#define ORDER_PRINT 0
#define ORDER_INSDERT 1
#define ORDER_POP 2





class Task
{
public:
    Task() //初始化
    {
        funcs.push_back(Print);
        funcs.push_back(Insert);
        funcs.push_back(POP);
    }
    void execute(int order)
    {
        if(order>=0&&order<funcs.size())
        {
            funcs[order]();  //调用该函数
        }
    }
    ~Task()
    {}


public:
vector<fun_t>funcs;

};